#include <iostream>

using namespace std;
class A
{
private:

public:
    A() {
        cout << "A()" << endl;
    }
    ~A() {
        cout << "~A()" << endl;
    }
    void run() {
        cout << "a" << endl;
    }
};

class B
{
private:
    A _a;
public:
    B() {
        cout << "B()" << endl;
    }
    ~B() {
        cout << "~B()" << endl;
    }
    void work() {
        cout << "B work.." << endl;
        _a.run();
        cout << "B end.." << endl;
    }
};

int main(int argc, char const *argv[])
{
    B *b = new B();
    b->work();
    // delete b;
    return 0;
}
